<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录 - 暖心助农选品平台</title>
    <!-- Bootstrap CSS -->
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.1/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.4.2/css/all.min.css" rel="stylesheet">
    <!-- Custom CSS -->
    <style>
        :root {
            --primary-color: #2ecc71;
            --secondary-color: #27ae60;
            --background-color: #f8f9fa;
            --text-color: #2c3e50;
        }
        
        body {
            font-family: "Microsoft YaHei", sans-serif;
            background-color: var(--background-color);
            color: var(--text-color);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }
        
        .btn-primary {
            background-color: var(--primary-color);
            border-color: var(--primary-color);
        }
        
        .btn-primary:hover {
            background-color: var(--secondary-color);
            border-color: var(--secondary-color);
        }
        
        .card {
            border: none;
            border-radius: 15px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.1);
        }
        
        .card-header {
            background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
            border-radius: 15px 15px 0 0 !important;
            border: none;
        }
        
        .form-control:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 0.25rem rgba(46, 204, 113, 0.25);
        }
        
        .form-check-input:checked {
            background-color: var(--primary-color);
            border-color: var(--primary-color);
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="row justify-content-center align-items-center min-vh-100">
            <div class="col-md-6 col-lg-5">
                <div class="text-center mb-4">
                    <a href="/" class="text-decoration-none">
                        <i class="fas fa-leaf fa-3x text-success"></i>
                        <h2 class="mt-2 text-success">暖心助农选品平台</h2>
                    </a>
                </div>
                <div class="card shadow-lg border-0">
                    <div class="card-header text-white text-center py-4">
                        <h3 class="mb-0">
                            <i class="fas fa-user-circle fa-2x mb-3"></i><br>
                            用户登录
                        </h3>
                    </div>
                    <div class="card-body p-4">
                        <div th:if="${param.error}" class="alert alert-danger">
                            用户名或密码错误
                        </div>
                        <div th:if="${param.logout}" class="alert alert-success">
                            您已成功退出登录
                        </div>
                        <form th:action="@{/login}" method="post">
                            <div class="form-floating mb-3">
                                <input class="form-control" id="username" type="text" name="username" required 
                                       placeholder="用户名" autofocus />
                                <label for="username">用户名</label>
                            </div>
                            <div class="form-floating mb-3">
                                <input class="form-control" id="password" type="password" name="password" required 
                                       placeholder="密码" />
                                <label for="password">密码</label>
                            </div>
                            <div class="form-check mb-3">
                                <input class="form-check-input" id="remember-me" type="checkbox" name="remember-me" />
                                <label class="form-check-label" for="remember-me">记住我</label>
                            </div>
                            <div class="d-grid gap-2">
                                <button class="btn btn-primary btn-lg" type="submit">
                                    <i class="fas fa-sign-in-alt me-2"></i>登录
                                </button>
                            </div>
                        </form>
                    </div>
                    <div class="card-footer text-center py-3">
                        <div class="small">
                            <a th:href="@{/register}" class="text-decoration-none text-success">
                                <i class="fas fa-user-plus me-1"></i>还没有账号？点击注册
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Bootstrap JS 和 Popper.js -->
    <script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.1/js/bootstrap.bundle.min.js"></script>
    <!-- jQuery -->
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
</body>
</html> 